<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
    <script src="../../res/js/jquery-3.4.1.min.js" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="../../res/css/base.css">
    <link rel="shortcut icon" type="image/x-icon" href="../../res/images/favicon.ico">
    <link rel="stylesheet" type="text/css" href="../../res/fonts/iconfont.css">
    <script type="text/javascript" src="../../res/framework/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="../../res/js/base.js"></script>
    <script src="../../res/js/login_common.js" charset="utf-8"></script>
    <script src="../../res/layui/layui.js" charset="utf-8"></script>
    <script src="../../res/framework/cframe.js"></script><!-- 仅供所有子页面使用 -->
    <script src="../../res/js/Tools.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../../res/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../res/layui_exts/laydateNote/laydateNote.css"/>
    <style type="text/css">
        .title {
            margin-top: 20px;
            width: 150px;
            height: 20px;
            border-left: 3px solid #087D9B;
            line-height: 20px;
            display: inline;
            float: left
        }

        .titles {
            width: 900px;
            height: 100px;
            float: left
        }

        .titles_div {
            width: 85px;
            height: 90px;
            float: left;
            margin: 10px;
            border: 1px solid royalblue;
        }

        .title_font {
            line-height: 20px;
            text-align: center
        }

        .title_iocn {
            margin: 0px auto;
            width: 70px;
            height: 70px;
            border: 1px solid royalblue;
        }
        .personalPolicy{
            width: 100%;
            height: 120px;
        }
        .personalPolicy li{
            width: 180px;
            height: 40px;
            float: left;
        }
        .noselect {
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -khtml-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }
    </style>
</head>
<body>
<!--头部导航栏-->
<ul class="layui-nav">
    <li style="width: 180px;float: left">
        <!--<span class="layui-badge">9</span>-->
        <a href="">
            <div style="width: 180px;height: 60px;font-size: 30px;color: white;font-family:'SimSun'">
                <img width="60px" src="../../res/images/dkmLogo.png" />
                典卡姆
            </div>
        </a>
    </li>
    <!--<li class="layui-nav-item">
        &lt;!&ndash;<span class="layui-badge">9</span>&ndash;&gt;
        <a href="">典卡姆Log</a>
    </li>-->
    <li class="layui-nav-item" lay-unselect="">
        <a href="javascript:;">员工自助</a>
        <dl class="layui-nav-child">
            <dd><a href="index.html">首页</a></dd>
            <dd><a href="personalIndex.html">员工自助</a></dd>
        </dl>
    </li>
    <!--<li class="layui-nav-item">
        <a>应用</a>
        <div class="layui-nav-child" style="width: 1200px;color: black;">
            <ul>
                <li>
                    <div class="title">&nbsp;&nbsp;&nbsp;行政办公</div>
                    <div class="titles">
                        <div class="titles_div">
                            &lt;!&ndash;接入流程管理（只显示待审流程） &ndash;&gt;
                            <div class="title_iocn"></div>
                            <div class="title_font">通用审批</div>
                        </div>
                        <div class="titles_div">
                            &lt;!&ndash;接入流程管理（显示所有流程） &ndash;&gt;
                            <div class="title_iocn"></div>
                            <div class="title_font">流程管理</div>
                        </div>
                        <div class="titles_div">
                            <div class="title_iocn"></div>
                            <div class="title_font">公文管理</div>
                        </div>
                        <div class="titles_div">
                            &lt;!&ndash; 接入流程管理只显示印章流程 &ndash;&gt;
                            <div class="title_iocn"></div>
                            <div class="title_font">印章证照管理</div>
                        </div>
                        <div class="titles_div">
                            <div class="title_iocn"></div>
                            <div class="title_font">办公用品管理</div>
                        </div>
                        <div class="titles_div">
                            <div class="title_iocn"></div>
                            <div class="title_font">实物资产管理</div>
                        </div>
                        <div class="titles_div">
                            <div class="title_iocn"></div>
                            <div class="title_font">通讯录</div>
                        </div>
                        <div class="titles_div">
                            <div class="title_iocn"></div>
                            <div class="title_font">投票管理</div>
                        </div>
                    </div>s
                </li>
                <li>
                    <div class="title">&nbsp;&nbsp;&nbsp;任务协作</div>
                    <div class="titles">
                        <div class="titles_div">
                            &lt;!&ndash;接入流程管理（只显示待审流程） &ndash;&gt;
                            <div class="title_iocn"></div>
                            <div class="title_font">会议管理</div>
                        </div>
                        <div class="titles_div">
                            &lt;!&ndash;接入流程管理（显示所有流程） &ndash;&gt;
                            <div class="title_iocn"></div>
                            <div class="title_font">督办任务</div>
                        </div>
                        <div class="titles_div">
                            <div class="title_iocn"></div>
                            <div class="title_font">任务管理</div>
                        </div>
                        <div class="titles_div">
                            &lt;!&ndash; 接入流程管理只显示印章流程 &ndash;&gt;
                            <div class="title_iocn"></div>
                            <div class="title_font">工作沟通</div>
                        </div>
                        <div class="titles_div">
                            <div class="title_iocn"></div>
                            <div class="title_font">日程管理</div>
                        </div>
                        <div class="titles_div">
                            <div class="title_iocn"></div>
                            <div class="title_font">工作总结</div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="title">&nbsp;&nbsp;&nbsp;信息中心</div>
                    <div class="titles">
                        <div class="titles_div">
                            &lt;!&ndash;接入流程管理（只显示待审流程） &ndash;&gt;
                            <div class="title_iocn"></div>
                            <div class="title_font">知识中心</div>
                        </div>
                        <div class="titles_div">
                            &lt;!&ndash;接入流程管理（显示所有流程） &ndash;&gt;
                            <div class="title_iocn"></div>
                            <div class="title_font">规范制度</div>
                        </div>
                        <div class="titles_div">
                            <div class="title_iocn"></div>
                            <div class="title_font">新闻管理</div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="title">&nbsp;&nbsp;&nbsp;管理应用</div>
                    <div class="titles">
                        <div class="titles_div">
                            &lt;!&ndash;接入流程管理（只显示待审流程） &ndash;&gt;
                            <div class="title_iocn"></div>
                            <div class="title_font">客户管理</div>
                        </div>
                        <div class="titles_div">
                            &lt;!&ndash;接入流程管理（显示所有流程） &ndash;&gt;
                            <div class="title_iocn"></div>
                            <div class="title_font">供应商管理</div>
                        </div>
                        <div class="titles_div">
                            <div class="title_iocn"></div>
                            <div class="title_font">付款合同管理</div>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </li>-->
    <li class="layui-nav-item" lay-unselect="" style="float: right">
        <a href="javascript:;"><!--<img src="//t.cn/RCzsdCq" class="layui-nav-img">--><span id="yly">我</span></a>
        <dl class="layui-nav-child">
            <dd><a href="personalIndex.html">个人空间</a></dd>
            <dd><a href="front/person/personelcenter.html">个人设置</a></dd>
            <dd style="border-bottom: 1px solid black;border-top: 1px solid black;height: 30px;line-height: 30px;display: none"
                id="back"><a
                    href="back/main.html" target="_blank">后台管理</a></dd>
            <dd><a href="front/person/updatePassWord.html">修改密码</a></dd>
            <dd><a href="javascript:removeUser();">退出</a></dd>
        </dl>
    </li>
    <li class="layui-nav-item" lay-unselect="" style="float: right">
        <a href="javascript:;">
            <i class="layui-icon layui-icon-notice layui-icon-face-smile" style="font-size: 30px;"></i>
            <span id="hint" class="layui-badge-dot" style="top: 35%;left: 45px"></span>
        </a>
        <dl class="layui-nav-child" style="width: 180px" id="message">
            <dd><a href="javascript:;">个人设置个人设置个人...</a></dd>
        </dl>
    </li>

</ul>
<!--左侧菜单栏-->
<div style="float: left;width: 10%;margin: 10px">
    <div style="width: 100%;margin: 10px;height: 180px;background: #087D9B;padding-top: 10px">
        <div style="width: 100px;height: 100px;border-radius: 50%;background: #47B3DB;margin: 10px auto;line-height: 100px;text-align: center;font-size: 50px;color: #FFFFFF"
             id="names">超
        </div>
        <div style="margin: 10px auto;width: 100%;text-align: center;color: #B1CAD1" id="userName">管理员</div>
        <div style="margin: 10px auto;width: 100%;text-align: center;color: #FFFFFF" id="companyName"></div>
    </div>
    <div style="width: 100%;margin: 10px">
        <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="demo" style="margin-right: 10px;width: 100%;">
            <li class="layui-nav-item layui-nav-itemed">
                <a href="javascript:;">个人操作</a>
                <dl class="layui-nav-child">
                    <dd><a href="front/record/recordShow.html" target = "_blank">档案信息查询</a></dd>
                    <dd><a href="front/flow/entryAlteration/entryAlterationForm.html" target = "_blank">档案信息变更</a></dd>
                    <dd><a href="javascript:unfinished();">每日考勤记录：未开启</a></dd>
                    <dd><a href="front/workSummary/workSummary.html">工作总结</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item layui-nav-itemed">
                <a href="javascript:;">人事异动</a>
                <dl class="layui-nav-child">
                    <dd><a href="front/flow/regular/regularFrom.html" target = "_blank">员工转正</a></dd>
                    <dd><a href="javascript:unfinished();" target = "_blank">员工调动：未开启</a></dd>
                    <dd><a href="front/flow/dimission/dimission.html" target = "_blank">员工离职</a></dd>
                </dl>
            </li>
        </ul>
    </div>
</div>
<!--正文-->
<div style="float: left;width: 40%;background: white;margin: 10px">
    <div style="width: 100%;height: 300px;background: white;padding-top: 10px">
        <div style="width: 98%;height: 280px;background: white;float: left;margin-left: 10px">
            <div class="layui-tab layui-tab-card">
                <ul class="layui-tab-title" id="newsType">

                </ul>
                <div class="layui-tab-content" id="news">

                </div>
            </div>
        </div>
    </div>
    <div style="width: 100%;height: 100px;background: white">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">HR指引</li>
            </ul>
            <div class="layui-tab-content" style="height: 100px;">
                <ul class="personalPolicy">
                    <li><a href="front/flow/regular/regularFrom.html" target = "_blank">员工转正</a></li>
                    <li><a href="javascript:unfinished();" target = "_blank">员工调动（未开启）</a></li>
                    <li><a href="front/flow/dimission/dimission.html" target = "_blank">员工离职</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<!--右侧菜单栏-->
<div style="float: left;width: 42%;background: white;margin: 10px">
    <div style="width: 100%;height: 300px;background: white">
        <div class="layui-tab layui-tab-card">
            <ul class="layui-tab-title">
                <li class="layui-this">待办</li>
                <li>待阅</li>
                <li>已办</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show" id="backlog">
                    1. 高度默认自适应，也可以随意固宽。
                    <br>2. Tab进行了响应式处理，所以无需担心数量多少。
                </div>
                <div class="layui-tab-item" id="toBeRead">内容3</div>
                <div class="layui-tab-item" id="haveDone">内容3</div>
            </div>
        </div>
    </div>
    <div style="width: 100%;height: 100px;background: white">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">HR办事服务</li>
            </ul>
            <div class="layui-tab-content" style="height: 100px;">
                <ul class="personalPolicy">
                    <li><a href="javascript:;" target = "_blank">档案信息查询</a></li>
                    <li><a href="front/flow/entryAlteration/entryAlterationForm.html" target = "_blank">档案信息变更</a></li>
                    <li><a href="javascript:;" target = "_blank">每日考情记录（未开启）</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>

<script>
    layui.use('element', function () {
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块

        let url = getRootPath() + "OaPersonnelAction/getUser";
        $.ajax({
            //请求方式
            type: "GET",
            //请求的媒体类型
            contentType: "application/json;charset=UTF-8",
            //请求地址
            url: url,
            //数据，json字符串
            async: true,
            //请求成功
            success: function (res) {
                console.log(res.data);
                $("#yly").html(res.data.personnelName);
                $("#userName").html(res.data.personnelName);
                $("#companyName").html(res.data.companyName);
                $("#names").html(res.data.personnelName.substr(0, 1));
            }
        });

        //监听导航点击
        element.on('nav(demo)', function (elem) {
            //console.log(elem)
            layer.msg(elem.text());
        });
    });
</script>
<script>
    //调用
    /*layui
        .config({
            base: '../../res/layui_exts' //假设这是你存放拓展模块的根目录
        })
        .extend({
            //设定模块别名
            laydateNote: '/laydateNote/laydateNote', //如果 mymod.js 是在根目录，也可以不用设定别名
            artTemplate: '/artTemplate/artTemplate'
        });

    layui.use(['laydateNote'], function () {
        //调用
        var laydateNote = layui.laydateNote;
        laydateNote({
            elem: '#test-n2', //容器id,CLass
            //  url: 'test2.json', //异步数据接口,本地浏览时可不设置
            sort: 'up', //日期排序，默认不设置不排序，up 日期升序，down 日期降序
            fine: '.laydateNotebook', //开启详细模式
            done: function (data, chooseData, type) {
                //回调数据，这里发送你的请求ajax
                console.log(data, chooseData, type)
            }
        });

    });*/

    $(function () {

        if (isButton("BACK")) {
            $("#back").show();
        }

        let res=getAjaxById(getRootPath()+"OaMessageAction/findAll");
        if(res.Backlog.length>0){
            $("#backlog").html(""); // 待办清空
            $("#message").html(""); // 清空导航栏通知
            $.each(res.Backlog,function (index,item) {
                console.info(item);
                $("#backlog").append('<div><a target="_blank" href="'+getRootPath()+item.messageUrl+item.formId+'">'+(index+1)+'. '+item.messageName+'</a></div>');
                $("#message").append('<dd><a target="_blank" href="'+getRootPath()+item.messageUrl+item.formId+'">'+(index+1)+'. '+item.messageName+'</a></dd>');
            });
        }else{
            $("#hint").hide();
            $("#backlog").html("暂无待办事项，喝杯茶好好休息一下吧！");
            $("#message").html('<dd><a href="javascript:;">暂无待办事项</a></dd>');
        }

        if(res.ToBeRead.length>0){
            $("#toBeRead").html(""); // 待阅清空
            $.each(res.ToBeRead,function (index,item) {

            });
        }else{
            $("#toBeRead").html("没有待阅事项哦~"); // 待阅清空
        }

        if(res.HaveDone.length>0){
            $("#haveDone").html(""); // 已办清空
            $.each(res.HaveDone,function (index,item) {
                $("#haveDone").append('<div><a target="_blank" href="'+getRootPath()+item.messageUrl+item.formId+'">'+(index+1)+'. '+item.messageName+'</a></div>');
            });
        }else{
            $("#haveDone").html("暂时还没有已办的事情哦"); // 已办清空
        }



        var url = getRootPath()+"OaPersonnelAction/getUser";
        $.ajax({
            //请求方式
            type: "GET",
            //请求的媒体类型
            contentType: "application/json;charset=UTF-8",
            //请求地址
            url: url,
            //数据，json字符串
            async: true,
            //请求成功
            success: function (res) {
                $("#yly").html(res.data.personnelName);
                $("#userName").html(res.data.personnelName);
            }
        });



    });
</script>
<script>
    $(function(){
        selectNewsType();
    });
    function openNews(obj) {
        layer.open({
            type: 2,
            title: '查看',
            shadeClose: true,
            shade: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['90%', '90%'],
            content: getRootPath()+'pages/dkmoa/back/news/newsShow.html?pkNewsId=' + obj
        });
    }
    function selectNewsType(){
        var url=getRootPath()+"NewsType/selectTypeAndNews";
        var data=null;
        $("#newsType").html("");
        $("#news").html("");
        $.ajaxSettings.async = false;
        $.get(url,data,function(obj){
            for(var i=0;i<obj.data.data.length;i++){
                if(i===0){
                    $("#newsType").append("<li class='layui-this'>"+obj.data.data[i].newsType.newsTypeName+"</li>");
                    $("#news").append("<div class='layui-tab-item layui-show' id='newsType_"+obj.data.data[i].newsType.pkNewsTypeId+"'></div>")
                }else{
                    $("#newsType").append("<li>"+obj.data.data[i].newsType.newsTypeName+"</li>");
                    $("#news").append("<div class='layui-tab-item' id='newsType_"+obj.data.data[i].newsType.pkNewsTypeId+"'></div>");
                }
                if (obj.data.data[i].news.length) {
                    for (var j = 0; j < obj.data.data[i].news.length; j++) {
                        if (obj.data.data[i].news[j]) {
                            $("#newsType_"+obj.data.data[i].newsType.pkNewsTypeId+"").append("<div style='cursor: pointer' onclick='openNews(\"" + obj.data.data[i].news[j].pkNewsId + "\")' >" + (j + 1) + ". " + obj.data.data[i].news[j].newsTitle + '<br>' + "</div>");
                        } else {
                            $("#newsType_"+obj.data.data[i].newsType.pkNewsTypeId+"").append("<div>没有任何内容</div>");
                        }
                    }
                } else {
                    $("#newsType_"+obj.data.data[i].newsType.pkNewsTypeId+"").append("<div>没有任何内容</div>");
                }
            }
        },"json");
    }

    function removeUser() {
        getAjaxById(getRootPath() + "OaPersonnelAction/logout");
        location.href = "login.html";
    }

    function unfinished() {
        layer.msg('功能未开启', {icon: 0});
    }
</script>
<div class="noselect" style="width: 100%;background:#087D9B;height: 49px;line-height: 49px;color: white;position: fixed;bottom:0px "> &nbsp;&nbsp;&nbsp;©
    2020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;湖南典卡姆信息科技有限公司
</div>
</body>
</html>